package kaizen;

// Decompiled by DJ v3.9.9.91 Copyright 2005 Atanas Neshkov  Date: 07/02/2013 05:25:21 p.m.
// Home Page : http://members.fortunecity.com/neshkov/dj.html  - Check often for new version!
// Decompiler options: packimports(3) 
// Source File Name:   ejecutaPost.java

import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.*;

public class ejecutaPost extends HttpServlet
{

    public ejecutaPost()
    {
    }

    public void init(ServletConfig config)
        throws ServletException
    {
        super.init(config);
    }

    public void destroy()
    {
    }

    protected void processRequest(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException
    {
        response.setContentType("text/html");
        PrintWriter out = response.getWriter();
        out.println("<html>");
        out.println(" <head>");
        out.println("  <title>Env\355a Solicitud a Bancomer.</title>");
        out.println(" </head>");
        out.println("<body>");
        String pag = "";
        pag = pag + " <SCRIPT LANGUAGE='JavaScript'> \n";
        pag = pag + " <!-- Begin \n";
        pag = pag + " var start=new Date(); \n";
        pag = pag + "\tstart=Date.parse(start)/1000; \n";
        pag = pag + "\t\tvar counts=3; \n";
        pag = pag + "\t\tfunction CountDown(){ \n";
        pag = pag + "\t\t\tvar now=new Date(); \n";
        pag = pag + "\t\t\tnow=Date.parse(now)/1000; \n";
        pag = pag + "\t\t\tvar x=parseInt(counts-(now-start),3); \n";
        pag = pag + "\t\t\tif(document.form1){ \n";
        pag = pag + "\t\t\t\tself.document.form1.clock.value = x; \n";
        pag = pag + "\t\t\t\tself.document.form1.tiempo.value = counts; \n";
        pag = pag + "\t\t\t} \n";
        pag = pag + "\t\t\tif(x>0){ \n";
        pag = pag + "\t\t\t  timerID=setTimeout('CountDown()', 100) \n";
        pag = pag + "\t\t\t}else{ \n";
        pag = pag + "\t\t\t  self.document.form1.botonSubmit.click();   \n";
        pag = pag + "\t\t\t\t \n";
        pag = pag + "\t\t\t} \n";
        pag = pag + "\t\t} \n";
        pag = pag + "\t//  End --> \n";
        pag = pag + "\t</script> \n";
        pag = pag + "\t<SCRIPT LANGUAGE='JavaScript'> \n";
        pag = pag + "\t<!-- \n";
        pag = pag + "\twindow.setTimeout('CountDown()',100); \n";
        pag = pag + "\t--> \n";
        pag = pag + "\t</script> \n";
        //pag = pag + "\t<form name='form1' action=\"http://www.bancomer.com/e-cobranza/cmoctez/principal/indexcmoctez.asp\" method='post'> \n";
        //pag = pag + "\t<form name='form1' action=\"https://www.bancomer.com/e-cobranza/cmoctez/principal/indexcmoctez.jsp\" method='post'> \n";
        pag = pag + "\t<form name='form1' action=\"https://www.bancomer.com/e-cobranza/cmoctez/principal/indexcmoctez.asp\" method='post'> \n";
        pag = pag + "\t  <input type='hidden' id='tiempo' name='tiempo' value='0'> \n";
        pag = pag + "\t  <input name='clock' type='hidden' id='clock' value='3'> \n";
        pag = pag + "\t  <input type='submit' id='botonSubmit' name='botonSubmit' value='.'> \n";
        pag = pag + "\t  <input type='button' id='botonCancelar' name='botonCancelar' value='Cerrar Ventana' onClick='window.close()'> \n";
        pag = pag + "\t  <input type='hidden' name='s_transm' value='" + request.getParameter("s_transm") + "'> \n";
        pag = pag + "\t  <input type='hidden' name='c_referencia' value='" + request.getParameter("c_referencia") + "'> \n";
        pag = pag + "\t  <input type='hidden' name='t_importe' value='" + request.getParameter("t_importe") + "'> \n";
        pag = pag + "\t  <input type='hidden' name='val_1' value='" + request.getParameter("val_1") + "'> \n";
        pag = pag + "\t  <input type='hidden' name='val_2' value='" + request.getParameter("val_2") + "'> \n";
        pag = pag + "\t</form> \n";
        out.println(pag);
        out.println("</body>");
        out.println("</html>");
        out.close();
    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException
    {
        processRequest(request, response);
    }

    protected void doPost(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException
    {
        processRequest(request, response);
    }
}